package com.sg.controller.bff;

import com.sg.service.biz.bff.FunctionalGoalService;
import com.sg.dto.biz.bff.req.BffAddTargetDetailsReqDto;
import com.sg.dto.biz.bff.req.BffQueryTargetDetailMgtListReqDto;
import com.sg.dto.biz.bff.req.BffQueryTargetDetailsListReqDto;
import com.sg.dto.biz.bff.req.BffUpdateTargetDetailReqDto;
import com.sg.dto.biz.bff.res.BffAddTargetDetailsRespDto;
import com.sg.dto.biz.bff.res.BffQueryTargetDetailMgtListRespDto;
import com.sg.dto.biz.bff.res.BffQueryTargetDetailsListRespDto;
import com.sg.dto.biz.bff.res.BffUpdateTargetDetailRespDto;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "FunctionalGoal", tags = {"FunctionalGoal"})
@RestController
// @RequestMapping("/oms/functionalGoal/")
public class FunctionalGoalController {

    @Autowired
    FunctionalGoalService functionalGoalService;

    /**
     * B1-3新增目标职责明细（管理）
     * gen by moon at 8/10/2022, 3:30:54 AM
     */
    @PostMapping("/oms/mgt/functionalGoal/addTargetDetails")
    @ApiOperation(value = "B1-3新增目标职责明细（管理）", response = OkrResult.class)
    public OkrResult<BffAddTargetDetailsRespDto> addTargetDetails(@RequestBody(required = false) @Validated BffAddTargetDetailsReqDto reqDTO) {
        return OkrResult.success(functionalGoalService.addTargetDetails(reqDTO));
    }

    /**
     * B1-3查询目标职责明细列表
     * gen by moon at 8/18/2022, 10:21:53 PM
     */
    @PostMapping("/oms/functionalGoal/queryTargetDetailsList")
    @ApiOperation(value = "B1-3查询目标职责明细列表", response = OkrResult.class)
    public OkrResult<BffQueryTargetDetailsListRespDto> queryTargetDetailsList(@RequestBody(required = false) @Validated BffQueryTargetDetailsListReqDto reqDTO) {
        return OkrResult.success(functionalGoalService.queryTargetDetailsList(reqDTO));
    }

    /**
     * B1-3修改目标职责明细（管理）
     * gen by moon at 8/10/2022, 3:30:56 AM
     */
    @PostMapping("/oms/mgt/functionalGoal/updateTargetDetail")
    @ApiOperation(value = "B1-3修改目标职责明细（管理）", response = OkrResult.class)
    public OkrResult<BffUpdateTargetDetailRespDto> updateTargetDetail(@RequestBody(required = false) @Validated BffUpdateTargetDetailReqDto reqDTO) {
        return OkrResult.success(functionalGoalService.updateTargetDetail(reqDTO));
    }

    /**
     * B1-3查询管理模式目标职责明细列表(管理)
     * gen by moon at 8/10/2022, 3:31:00 AM
     */
    @PostMapping("/oms/mgt/functionalGoal/queryTargetDetailMgtList")
    @ApiOperation(value = "B1-3查询管理模式目标职责明细列表(管理)", response = OkrResult.class)
    public OkrResult<BffQueryTargetDetailMgtListRespDto> queryTargetDetailMgtList(@RequestBody(required = false) @Validated BffQueryTargetDetailMgtListReqDto reqDTO) {
        return OkrResult.success(functionalGoalService.queryTargetDetailMgtList(reqDTO));
    }
}
